s with known parameters. The following code can be used,
rm(x,mean=mu1,sd=sigma1)+
rm(x,mean=mu2,sd=sigma2)
bove approach requires the component parameters to be known
ce. The component parameters of a mixture model can be
d using an R package mclust, for which the R function is named
st,
Mclust(x,G=NULL,···)
rst input is a vector or a matrix. The second input is used to define
onent number or a set of the component numbers. The second
n be a scalar number to specify the component number. For
using G=3 will employ three components. It can also be a vector
G=2:5, which means that a density function estimation process
four models using two, three, four and five components. The
finds the best model to fit to a data set among these four models.
main output of the Mclust function includes a component
f a Gaussian mixture ($G) and the component parameters, which
parameter. The $parameter object includes the mixing
nts ($pro), the mean values ($mean) and the variances
ance) for an estimated density function. Here a toy data was used
strate how it works,
.24,-1.24,0.74,0.38,1.49,0.19,0.30,
0.99,0.58,-0.46,1.17,-2.89,-2.04,
0.82,0.92,0.91,-0.88,1.06,0.95,0.44,
1.16,-1.12,10.75,4.05,3.23,
.85,-1.56,4.21,9.34,8.05)
the Mclust function was called to estimate a density function
ata set, G was set two for employing two Gaussian densities for
,
model=Mclust(x,G=2)